1. Field of the Invention
The present invention relates to an arithmetic-logic unit (hereinafter called ALU) for processing given data, and a microprocessor and data processing unit using the ALU. More particularly, the present invention relates to an ALU, microprocessor and data processing unit having an operation function suitable for processing a communications protocol.
2. Description of the Related Art
A microprocessor or data processing unit has an embedded ALU which has a function of performing arithmetic operations such as addition, subtraction, multiplication and division of generally two numeric values, and of performing a logical operation such as AND and OR of numeric values. Such microprocessors or data processing units are used in various technical fields. An example is a communication controller.
In the field of communications networks, a communications protocol including flow control and error recovery requires modulo operations such as modulo comparison and modulo addition/subtraction in order, for example, to judge whether numeric data B cyclically changing its value within a predetermined range has a predetermined relation to boundary data A and C. If such a modulo operation is executed by a conventional microprocessor having only a function of processing two values, a number of instruction steps become necessary in order to obtain desired operation results, being unable to speed up processing a communications protocol.
As a conventional technique for speeding up a comparison operation between three values, there has been proposed an arithmetic-logic unit (ALU) of the type described, for example, in JP-B-63-12302. This ALU can judge whether two real number data A and B satisfy a relation of A-C.ltoreq.B.ltoreq.A+C (C is an allowable error).
However, this conventional ALU has only a function of simply comparing three input values (hereinafter called three-input), and is not provided with a function of performing a modulo addition, subtraction, or comparison operation between three inputs, necessary for processing a communications protocol. It is therefore necessary for this conventional ALU to execute a number of instruction steps in order to process a communications protocol, being unable to realize high speed processing.